<template>
  <div>
  <div  class="homeContainer">
      <div  style=" display: flex; height: 60px; line-height: 60px; align-items: center;">
      <div style=" display: flex; align-items: center; margin-left: 30px;cursor: pointer;">

        <div>学成平台</div>
      </div >
      <div  style=" display: flex; align-items: center; margin-left: auto; margin-right: 20px; ">
        <el-menu  
        router
        default-active="2-4-2"
        mode="horizontal"
        background-color="#017bc4"
        text-color="white"
        active-text-color="orange"
        style="margin-left: 30px" >
          <el-menu-item v-for="item in menus" :index="item.link" :key="item.id">
              <template slot="title"><i :class="item.icon"></i><span>{{ item.name }}</span></template>
          </el-menu-item>
      </el-menu>
      </div>



        <div  style=" display: flex; align-items: center; margin-left: auto; margin-right: 20px; ">
          <li>admin</li>
        </div>
    </div>
  </div>
    <el-container>
      
      <el-container>
      
        <el-main >
          <router-view></router-view>
        </el-main>


        <el-aside width="200px">Aside</el-aside>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
    data(){
      return {
        menus: [],
      }
    },
    methods:{
      queryMenus() {

      this.$axios.get('api/index/menu')
        .then(res => {
          console.log(res.data)
          this.menus = res.data
        })
    },

    },
    created() {
        this.queryMenus();
    }
}
</script>

<style lang="scss" scoped>
.homeContainer {
  background-color: #017bc4;
  li {
    list-style-type: none;
    padding: 0 10px;
    cursor: pointer;
    &:hover {
      background-color: rgba(0, 0, 0, 0.124);
    }
  }
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 200px;
    margin: 0;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
  
  }
</style>